#pragma once 

#define _WIN32_WINNT  0x0501
#define _TOOLSCOUNT	15

#include "precom.h"
#include "resource.h"

#include <vector>
#include <cassert>
//#include "resource1.h"
//#include "Dialogs.h"

class BaseWindow {
private:
protected:
	//	Stale...
	static const TCHAR* CLASS_NAME;// = L"JurkowskimWindow";
	static const TCHAR* MSG_NAME;// = L"JurkowskimWindow";
	//	Zmienne...
	HGLRC	hRC;		// Pernament Rendering Context
	HDC		hDC;		// Private GDI Device Context
	HWND	hWnd;		// Holds Our Window Handle
	HWND	hTools;		// Holds ToolRebar Handle
	HBITMAP	hToolBmp;
	TBBUTTON tbb[_TOOLSCOUNT];
	HINSTANCE hInst;	// Holds The Instance Of The Application

	bool	fullScreen;
	bool	activate;
	int		wndWidth, wndHeight, toolHeight;
	POINTS	point;
    //Dialogs dialog;
						// METODY
	DWORD	GetWindowStyle();
	void	CreateToolbar();
public:
	//	Konstruktory i Destruktor klasy...
	BaseWindow(HINSTANCE hInst);
	~BaseWindow();
	
	// Metody do obslugi okna i timera...
	static LRESULT CALLBACK		WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
	LRESULT						OnWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
	static void CALLBACK		TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
	void CALLBACK				OnTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime);
	
	inline void SetHInstance(HINSTANCE hI) { this->hInst = hI; }
	void	Exit();
	void	CreateWndClass(HICON hIcon);
	void	CreateWnd();
	void	ResizeWindow();
	int		Run();
	int		Go(HICON hicon);

	//	Do przeciazania w klasach dziedziczacych...
	virtual void Draw() {}
	virtual void SizeChanged() {}
	virtual void MinimalizedEnable() {}
	virtual void MinimalizedDisable() {}
	virtual void OnInit() {}
	virtual void OnCreate() {}
    virtual void OnWmCreate() {}
	virtual void OnDestroy() {}
	virtual void OnMenuChoosed(WPARAM wParam) {}
	virtual void OnToolbarChoosed(WPARAM wParam) {}
	virtual void OnLButtonDown(WPARAM wParam, LPARAM lParam) {}
	virtual void OnRButtonDown(WPARAM wParam, LPARAM lParam) {}
	virtual void OnMouseMove(WPARAM wParam, LPARAM lParam) {}
	virtual void OnMouseWheel(WPARAM wParam, LPARAM lParam) {}
	virtual void OnKeyDown(WPARAM wParam) {}
	virtual void OnKeyUp(WPARAM wParam) {}
	virtual void OnTimerMethod() {}
	virtual void Update() {}
};